package com.zboot.zbootadmin.common.config.staticResource;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author: zyt
 * @Description: 静态资源访问
 * @Date: Created in 15:33 2020/7/9
 */
@Configuration
public class MyWebAppConfiguration implements WebMvcConfigurer {

    @Value("${file.profile}")
    private String savePath;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/uploadPath/**").addResourceLocations("file:"+savePath+"/");
    }
}
